package com.woniuxy.background.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/user/userList").setViewName("users/userList");
        registry.addViewController("/login").setViewName("login");
        registry.addViewController("/user/addUser").setViewName("users/addUser");
        registry.addViewController("/sys/index").setViewName("sys/index");
        registry.addViewController("/sys/main").setViewName("sys/main");
        registry.addViewController("/sys/roleList").setViewName("sys/roleList");
        registry.addViewController("/sys/addRole").setViewName("sys/addRole");
        registry.addViewController("/sys/menuList").setViewName("sys/menuList");
        registry.addViewController("/sys/adminList").setViewName("sys/adminList");
        registry.addViewController("/log/logList").setViewName("log/logList");
        registry.addViewController("/ts/tsList").setViewName("ts/tsList");
        registry.addViewController("/cmt/cmtList").setViewName("cmt/cmtList");
        registry.addViewController("/good/goodList").setViewName("good/goodList");
        registry.addViewController("/good/goodTypeList").setViewName("good/goodTypeList");
        registry.addViewController("/order/allList").setViewName("order/allList");
        registry.addViewController("/order/orderList").setViewName("order/orderList");
    }
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/src/**").addResourceLocations("classpath:/static/src/");
        registry.addResourceHandler("/static/src/**").addResourceLocations("classpath:/static/src/");
    }
}
